#include<bits/stdc++.h>

using namespace std;

int a[4000010];

int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		int n,k;
		int ans = 0;
		int step = 0;
		cin>>n>>k;
		for(int i = 1; i <= k; i++)
		{
			cin>>a[i];
		}
		sort(a+1, a+k+1);
		for(int i = k; i >= 1; i--)
		{
			if(step + (n - a[i]) <= n - 1)
			{
				step += (n - a[i]);
				ans++;
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}
